local socket = require "skynet.socket"
local proto_manager = require "common.proto_manager"
local message_packet = require "common.message_packet"

local Connecter = {}

function Connecter:new(fd)
    local o = {
        fd = fd or nil,
    }
    setmetatable(o,self)
    self.__index = self
    return o
end

function Connecter:sendRawMessage(buf)
    return socket.write(self.fd,buf)
end

function Connecter:sendMessage(id,t,message)
    local pack = message_packet.packSendBuffer(id,t,message)
    socket.write(self.fd, pack)
end

return Connecter